package com.lsf.action;

import com.lsf.service.UserService;
import com.opensymphony.xwork2.ActionSupport;

/**

 * 创建日期：2013-3-4上午10:48:22

 * 修改日期：

 * 作者：刘帅飞

 */

public class UserDeleteAction extends ActionSupport{
	private String username;			//用户名
	private UserService userService;	//用户业务接口

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
//	public UserService getUserService(){
//		return userService;
//	}

	public String execute() throws Exception {
		if(userService.deleteUser(username)) {		//调用删除用户业务方法
			this.addActionMessage("删除用户成功!");
		}else {
			this.addActionMessage("删除用户失败!");
		}
		return SUCCESS;
	}
}
